home *** CD-ROM | disk | FTP | other *** search
- unit TestLBU;
-
- // Remove period to fix the TCustomList.ItemIndex bug
- {.$DEFINE FIX_BUG}
-
- interface
-
- uses
- {$IFDEF FIX_BUG}
- FixupLB,
- {$ENDIF}
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TTestLBForm = class(TForm)
- ListBox1: TListBox;
- Test: TButton;
- procedure TestClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- TestLBForm: TTestLBForm;
-
- implementation
-
- {$R *.DFM}
-
- procedure TTestLBForm.TestClick(Sender: TObject);
- begin
- ListBox1.MultiSelect := false;
- ListBox1.ItemIndex := -1;
- if ListBox1.ItemIndex >= 0
- then ShowMessage('TCustomList.ItemIndex is buggy!')
- else ShowMessage('TCustomList.ItemIndex is fixed!');
- end;
-
- end.
-